<template>
  <div class="cs-page-container">
    <div class="cs-filter-container">
      <el-button
        type="primary"
        @click="editPool"
      >修改扭蛋公池</el-button>
    </div>
  </div>
</template>

<script>
  import { xhrUpdateEggPublicPool } from '@/api/analysis'
  export default {
    name: 'modifyPool',

    methods: {
      editPool(){
        this.$prompt('请输入新的公池(只在测试环境中可以使用)', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
        }).then(({ value }) => {
          xhrUpdateEggPublicPool({publicPool: value}).then(resp =>{
            this.$message.success("修改成功")
          }).catch(err => {
            this.$message.error("修改失败")
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '取消输入'
          });
        });
      }
    }
  }
</script>

<style scoped>

</style>
